import {http} from '@/utils/http'

export function usePmProjectApi() {
  return {
    // 获得项目信息
    getItemInformation(id: string) {
      return http.get('/prod-api/admin-api/project/item-information/get?id=' + id)
    },
    // 获得项目信息
    getProjectDetailInfo(projectNumber: string) {
      return http.get<ProjectDetail>('/prod-api/admin-api/project/item-information/getDetailByProjectNumber?projectNumber=' + projectNumber)
    },
    // 获取项目各事项待办状态
    getAllWorkItemStatus(projectNumber: string) {
      return http.get('/prod-api/admin-api/project/item-information/getPendingStatus?projectNumber=' + projectNumber)
    },
    // 获取项目各流程结果
    getProjectProcessStatus(projectNumber: string) {
      return http.get<ProjBusinessProcessResult>('/prod-api/admin-api/project/service-startup/getBusinessProcessResults?projectNumber=' + projectNumber)
    },
    // 获得项目信息分页
    getItemInformationPage(query: any) {
      return http.get('/prod-api/admin-api/project/item-information/page', query)
    },
    // 获得项目信息分页
    getItemInfoAllInfoPage(query: any) {
      return http.get('/prod-api/admin-api/project/item-information/allInfoPage', query)
    },
    getItemInfoByProjNum(projectNumber: string) {
      return http.get(`/prod-api/admin-api/project/item-information/getByProjectNumber?projectNumber=${projectNumber}`)
    },
    getProjectNumber(id: string) {
      return http.get<string>(`/prod-api/admin-api/project/item-information/projectNumber/${id}`)
    }
  }
}
